/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package crm.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author abet
 */
@Entity
@Table(name="crm_project")
public class Project {
    @Id
    @Column(name="project_id", length=10, nullable=false)
    private String prId;
    @Column(name="project_name", length=255, nullable=false,unique=true)
    private String prName;
    @Column(name="project_decription", length=255, nullable=false)
    private String prDescription;
    @Column(name="project_start_date", length=20, nullable=false)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date prStartDate;
    @Column(name="project_end_date", length=20, nullable=false)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date prEndDate;
    @Column(name="project_progress_range", length=50, nullable=false)
    private String prProgressRange;
    @Column(name="project_progress_description", length=255, nullable=false)
    private String prProgressDesc;
    @Column(name="project_status", length=50, nullable=false)
    private String prStatus;
    @Column(name="project_amount", length=50, nullable=false)
    private long prAmount;
    @Column(name="project_contract_number", length=20, nullable=false)
    private String prContractNumber;
    @ManyToOne
    @JoinColumn(name="client_id",insertable=false,updatable=false)
    private Client client;
    @ManyToOne
    @JoinColumn(name="client_id",insertable=false,updatable=false)
    private User user;
    @OneToMany(mappedBy="project", cascade=CascadeType.ALL)
    private List<Activity> daftarActivity= new ArrayList<Activity>();

    public String getPrProgressDesc() {
        return prProgressDesc;
    }

    public void setPrProgressDesc(String prProgressDesc) {
        this.prProgressDesc = prProgressDesc;
    }

    public String getPrProgressRange() {
        return prProgressRange;
    }

    public void setPrProgressRange(String prProgressRange) {
        this.prProgressRange = prProgressRange;
    }

    public List<Activity> getDaftarActivity() {
        return daftarActivity;
    }

    public void setDaftarActivity(List<Activity> daftarActivity) {
        this.daftarActivity = daftarActivity;
    }


    public String getPrStatus() {
        return prStatus;
    }

    public void setPrStatus(String prStatus) {
        this.prStatus = prStatus;
    }
  
    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public long getPrAmount() {
        return prAmount;
    }

    public void setPrAmount(long prAmount) {
        this.prAmount = prAmount;
    }

    public String getPrContractNumber() {
        return prContractNumber;
    }

    public void setPrContractNumber(String prContractNumber) {
        this.prContractNumber = prContractNumber;
    }

    public String getPrDescription() {
        return prDescription;
    }

    public void setPrDescription(String prDescription) {
        this.prDescription = prDescription;
    }

    public Date getPrEndDate() {
        return prEndDate;
    }

    public void setPrEndDate(Date prEndDate) {
        this.prEndDate = prEndDate;
    }

    public String getPrId() {
        return prId;
    }

    public void setPrId(String prId) {
        this.prId = prId;
    }

    public String getPrName() {
        return prName;
    }

    public void setPrName(String prName) {
        this.prName = prName;
    }

    public Date getPrStartDate() {
        return prStartDate;
    }

    public void setPrStartDate(Date prStartDate) {
        this.prStartDate = prStartDate;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    
}
